package PlaneGame.CODE;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import static PlaneGame.CODE.GameFrame.*;
public class BulletA extends AutoMove{
    boolean haveHit;
    String[] paths2;
    public BulletA(int x,int y) {
        super();
        this.speed=-10;//速度为负表示向上移动
        if (mrW.NB) {
            this.width=10;
            this.height=24;
        }else {
            this.width=5;
            this.height=12;
        }
        this.x=x-this.width/2;
        this.y=y;
        this.imageNumber=1;
        this.paths= new String[]{"src/PlaneGame/IMAGE/bullet1.png"};
        this.paths2=new String[]{"src/PlaneGame/IMAGE/bomb.png"};
        images=new BufferedImage[imageNumber];
        for (int i = 0; i < images.length; i++) {
            try {
                if(mrW.NB){
                    images[i] = ImageIO.read(new File(paths2[i]));
                }else {
                    images[i] = ImageIO.read(new File(paths[i]));
                }
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
    }

    @Override
    void init() {
        super.init();
        haveHit=false;
    }
}